<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:output method="html" indent="yes"/>
<xsl:include href="http://localhost:8080/wsd_assign2/header.xsl" />
<xsl:param name="title"  />
<xsl:template match="result">
<script type='text/javascript' src='js/item.js'></script>

<link rel="stylesheet" type="text/css" href="css/item.css"></link>
  

  <input type="button" value="Donate" id="donateButton"/> <br />

  
  <table>
		
		<tbody>
		
		<!-- Display thumbnail -->
		<xsl:variable name="imgUrl"><xsl:value-of select="item/thumbnail/url" /></xsl:variable>
		<xsl:if test="$imgUrl != ''">
	    	<img src="{$imgUrl}" width="100" height="100"></img>
	    </xsl:if>
	    
	    <xsl:if test="$imgUrl=''" >
	    	<img src="img/cry-face-main.jpg" width="100" height="100"></img>
	    </xsl:if>
	    <br />
	    
		<h2>Type</h2> <br />
		<xsl:for-each select="item/names/item">
			<xsl:variable name="itemType"><xsl:value-of select="." /></xsl:variable>
			<a href="similarObj.jsp?type={$itemType}"><xsl:value-of select="." /></a> <br />
		</xsl:for-each>
		<h2>Subjects</h2> <br />
		<xsl:for-each select="item/subjects/item">
			<xsl:variable name="subject"><xsl:value-of select="." /></xsl:variable>
			<a href="relatedSubject.jsp?subject={$subject}">
			<xsl:value-of select="." /></a><br />
		</xsl:for-each>
		<h2>Categories</h2> <br />
		<xsl:for-each select="item/categories/item"><xsl:value-of select="." /><br /></xsl:for-each>
		<h2>Tags</h2> <br />
		<xsl:for-each select="item/tags/*"><xsl:value-of select="." /><br /></xsl:for-each>
		<xsl:apply-templates/>
		 
		
		</tbody>
	
	</table>
    
  
</xsl:template>

<xsl:template match="item/*">
	<xsl:variable name="nodeValue"><xsl:value-of select="." /></xsl:variable>
	<xsl:if test="$nodeValue!='None'">
	 <p><h3><xsl:value-of select="name()"/>:</h3> <xsl:apply-templates /> </p> 
 	</xsl:if>

</xsl:template>


<xsl:template match="item/*/*">
	 <xsl:variable name="nodeValue"><xsl:value-of select="." /></xsl:variable>
	 <xsl:if test="$nodeValue!='None'">
	 	<p><span>******    </span>   <h4><xsl:value-of select="name()"/>:</h4> <xsl:apply-templates /></p> 
	 </xsl:if>
</xsl:template>


<xsl:template match="status"></xsl:template>



</xsl:stylesheet>
